class GameSetting extends eui.Component implements  eui.UIComponent {
	
	public btn_comfirm:eui.Button;
	public btn_music:eui.Button;
	public btn_music_dis:eui.Image;
	public btn_effect:eui.Button;
	public btn_effect_dis:eui.Image;


	private static shared:GameSetting;
	public static getInstance(){
		if(!GameSetting.shared){
			GameSetting.shared=new GameSetting();
		}
		return GameSetting.shared;
	}

	public constructor() {
		super();
		this.init();
	}
	//添加皮肤时自动调用该函数
	protected partAdded(partName:string,instance:any):void
	{
		super.partAdded(partName,instance);
	}
	//组件加载完毕之后调用该函数
	protected childrenCreated():void
	{
		super.childrenCreated();
	}
	private init()
	{
		this.btn_comfirm.addEventListener(egret.TouchEvent.TOUCH_TAP,this.comfirm_tap,this);
		this.btn_music.addEventListener(egret.TouchEvent.TOUCH_TAP,this.music_tap,this);
		this.btn_effect.addEventListener(egret.TouchEvent.TOUCH_TAP,this.effect_tap,this);
		//获取之前的设置
	}
	private comfirm_tap()
	{
		SoundManager.getInstance().playClick();
		let parent:egret.DisplayObjectContainer=this.parent;
		parent.removeChild(this);
	}
	private music_tap()
	{
		SoundManager.getInstance().playClick();

		SoundManager.getInstance().isMusic=!SoundManager.getInstance().isMusic;
	}
	private effect_tap()
	{
		SoundManager.getInstance().playClick();
		
		SoundManager.getInstance().isEffect=!SoundManager.getInstance().isEffect;
	}
}